{extend name="base/index"/}

{block name="page_location"}
<div class="row">
	<div class="col-12">
		<div class="page-title-box">
			<div class="page-title-right">
				<ol class="breadcrumb m-0">
					<li class="breadcrumb-item"><a href="{:url('index/index')}">管理中心</a></li>
					<li class="breadcrumb-item active"><i class="iconfont icon-angle-right"></i>系统日志</li>
				</ol>
			</div>
			<h4 class="page-title">
				系统日志列表
			</h4>
		</div>
	</div>
</div>
{/block}
{block name="body"}
<link rel="stylesheet" href="__PLUGIN__/jQuery.cxCalendar/css/jquery.cxcalendar.css" />	
<div class="row" id="manual_list_page">
	<div class="col-12">
		<div class="card">
			<div class="card-body">
				<form action="{:url('syslog/index')}" method="get" id="search_frm">
					<div class="form-row align-items-center">
						<div class="col-auto">
							<label class="sr-only" for="inlineFormInputGroup"></label>
							<div class="input-group mb-2">
								<div class="input-group-prepend">
									<div class="input-group-text">选择状态</div>
								</div>
								<select class="form-control" tabindex="1" name="type">
									<option value="">所有日志</option>
									<option value="1" {eq name="type" value="1"}selected="selected"{/eq}>系统日志</option>
									<option value="2" {eq name="type" value="2"}selected="selected"{/eq}>会员日志</option>
									<option value="3" {eq name="type" value="3"}selected="selected"{/eq}>订单日志</option>
									<option value="4" {eq name="type" value="4"}selected="selected"{/eq}>支付日志</option>
									<option value="5" {eq name="type" value="5"}selected="selected"{/eq}>短信日志</option>
								</select>
							</div>								
						</div>	
						<div class="col-auto">
							<label class="sr-only" for="inlineFormInputGroup"></label>
							<div class="input-group mb-2">
								<div class="input-group-prepend">
									<div class="input-group-text">开始</div>
								</div>
								<input type="text" class="form-control" name="stime" placeholder="选择开始时间" value="{$stime}">
							</div>
						</div>
						<div class="col-auto">
							<label class="sr-only" for="inlineFormInputGroup"></label>
							<div class="input-group mb-2">
								<div class="input-group-prepend">
									<div class="input-group-text">结束</div>
								</div>
								<input type="text" class="form-control" name="etime" placeholder="选择开始时间" value="{$etime}">
							</div>
						</div>
						<div class="col-auto">
							<label class="sr-only" for="inlineFormInputGroup"></label>
							<div class="input-group mb-2">
								<div class="input-group-prepend">
									<div class="input-group-text">搜索</div>
								</div>
								<input type="text" class="form-control kw enter_goto" name="kw" placeholder="搜索会员名、订单号、收货人、电话" value="{$kw}">
							</div>
						</div>
						<div class="col-auto">
							<button type="submit" class="btn btn-primary mb-2">搜索</button>
						</div>
					</div>
				</form>
				<table class="table table-centered mb-0">
                    <thead>
                        <tr>
                            <th width="5%">ID</th>
                            <th width="10%">日志类型</th>
                            <th width="10%">会员名</th>
                            <th width="10%">日志信息</th>
                            <th width="10%">操作结果</th>
                            <th width="10%">操作者IP</th>
                            <th width="10%">操作时间</th>
                        </tr>
                    </thead>
                    <tbody>
						{volist name="list" id="data"}
                        <tr>
                            <td>{$data.id}</td>
                            <td>
                            	{switch name="data.type"}
                            		{case value="1"}系统日志{/case}
                            		{case value="2"}会员日志{/case}
                            		{case value="3"}订单日志{/case}
                            		{case value="4"}支付日志{/case}
                            		{case value="5"}短信日志{/case}
                            	{/switch}
                            </td>
                            <td>{$data.uname}</td>
                            <td>{$data.msg}</td>
                            <td>
                            	{eq name="data.result" value="1"}
                            		<span class="badge badge-secondary">操作失败</span>
                            	{else /}
                            		<span class="badge badge-primary">操作成功</span>
                            	{/eq}
                            </td>
                            <td>{$data.ip}</td>
                            <td title="{$data.time|date="Y-m-d H:i:s",###}"><span class="badge badge-primary">{$data.time|date="Y-m-d H:i",###}</span></td>
                        </tr>
						{/volist}
                    </tbody>
                </table>	
				<div class="row">
					<div class="col-12" style="text-align: center;">
						{$pagelist}
					</div>
				</div>								
			</div>
		</div>
	</div>
</div>
{/block}
{block name="script"}
<script type="text/javascript" src="__PLUGIN__/jQuery.cxCalendar/js/jquery.cxcalendar.min.js"></script>
<script type="text/javascript" src="__PLUGIN__/jQuery.cxCalendar/js/jquery.cxcalendar.languages.js"></script>
<script type="text/javascript">
$(function(){
	$("input[name=stime]").cxCalendar({type: 'datetime',format: 'YYYY-MM-DD HH:mm:ss'});
	$("input[name=etime]").cxCalendar({type: 'datetime',format: 'YYYY-MM-DD HH:mm:ss'});
});
</script>
{/block}